#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    string solve(string s, string t)
    {
        reverse(s.begin(), s.end());
        reverse(t.begin(), t.end());
        int m = s.size(), n = t.size();
        vector<int> v(m + n);
        for (int i = 0; i < m; i++)
        {
            for (int j = 0; j < n; j++)
            {
                v[i + j] += (s[i] - '0') * (t[j] - '0');
            }
        }
        string ret;
        int c = 0;
        for (auto x : v)
        {
            c += x;
            ret += (c % 10 + '0');
            c /= 10;
        }
        while (c)
        {
            ret += (c % 10 + '0');
            c /= 10;
        }
        while (ret.size() > 1 && ret.back() == '0') ret.pop_back();
        reverse(ret.begin(), ret.end());
        return ret;
    }
};